var ReviewForm = (function($) {
	var s,
	settings = {
		showBtn: $('.js-form-modal-show'),
		modal: $('.js-form-modal'),
		cancelBtn: $('.js-form-modal .btn-cancel'),
		submitBtn: $('.js-form-modal .btn-submit'),
		fields: $('.js-form-modal .js-required'),
		form: $('.js-form-modal .wizard-form')
	};
	
	/**
	 * 初始化模块
	 */
	var fire = function() {
		s = settings;
		_bindUIActions();
	};
	
	/**
	 * 绑定UI事件
	 */
	var _bindUIActions = function() {
		s.submitBtn.on('click', function(event) {
			event.preventDefault();
			var flag = false;
			s.fields.each(function(index, el) {
				if($(this).val() == '') {
					flag = true;
				}
			});
			if(flag) {
				alert('内容不能为空!');
			}
			_submitForm();
		});

		s.cancelBtn.on('click', function(event) {
			event.preventDefault();
			s.modal.removeClass('is-active');
		});

		s.showBtn.on('click', function(event) {
			event.preventDefault();
			s.modal.addClass('is-active');
		});
	}

	var _submitForm = function() {
		s.form.submit();
	}

	return {
		fire: fire
	}
	
})(Zepto);